<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="DBController.*" %>
<%@ page import="java.util.List" %>
<%@page import="java.util.ArrayList"%>
<%
DBConnector dbConn = DBConnector.getInstance();
int checkType = Integer.parseInt(request.getParameter("checkType"));
boolean checkExited = false;
if(checkType==1){
String userName = request.getParameter("userName");
checkExited = dbConn.isUserNameExisted(userName);
}
else
{
String email = request.getParameter("email");
checkExited = dbConn.isEmailExisted(email);
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div id="checkUserName"><%if(checkExited){%><label>This user had already existed</label><%}%><%else{ %><label>This user OK</label><%} %>
</div>
<div id="checkEmail"><%if(checkExited){%><label>This Email had already existed</label><%}%><%else{ %><label>This Email OK</label><%} %>
</div>
</body>
</html>